package rest

import (
	"zstackgo/pkg/core"
	"zstackgo/pkg/core/cloudbus"
	"zstackgo/pkg/header/message"
	"zstackgo/spring"
)

func init() {
	o := new(RESTApiFacadeImpl)
	spring.Register(o, "RESTApiFacade", []*spring.PluginExtension{
		{
			Interface: "header.Component",
		},
		{
			Interface: "header.Service",
		},
	})
}

type RESTApiFacadeImpl struct {
	bus *cloudbus.CloudBus
}

func (impl *RESTApiFacadeImpl) HandleMessage(msg message.Message) {
}

func InitMaxRestResultLength() uint64 {
	limit := core.StaticCoreGlobalProperty.RESTApiResultMaxLength
	if limit > 64000 {
		limit = 64000
	}
	if limit < 1000 {
		limit = 1000
	}
	return limit
}
